from ultralytics import YOLO
from PIL import ImageFont
font = ImageFont.truetype("arial.ttf", size=16)
a1 =YOLO('yolov8n.pt')
a1.train(
    data='tianniu.yaml',#数据集配置文件路径
    epochs=100,#训练轮次
    imgsz=640,#输入图片尺寸
    batch=16,#每次训练的批量
    device='cpu'
)
print('over')